package com.xx.happychatboot.middleware.rocketmq.consumer;

import com.xx.happychatboot.middleware.netty.service.WebSocketService;
import com.xx.happychatboot.middleware.rocketmq.constants.RocketMqConstants;
import com.xx.happychatboot.middleware.rocketmq.domain.dto.RocketMqCommonDto;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 添加好友rocketmq监听者
 */
@RocketMQMessageListener(consumerGroup = RocketMqConstants.AGREE_ADD_FRIEND_GROUP, topic = RocketMqConstants.AGREE_ADD_FRIEND_TOPIC)
@Component
public class AgreeAddFriendConsumer implements RocketMQListener<RocketMqCommonDto> {

    @Autowired
    private WebSocketService webSocketService;

    @Override
    public void onMessage(RocketMqCommonDto rocketMqCommonDto) {
        // 执行对应操作
        webSocketService.rocketMqExecute(rocketMqCommonDto);
    }
}
